﻿using System;

namespace SlamCms.Data
{
	public class TrackPage
	{
		public Guid TrackPageId { get; set; }
		public Guid TrackVisitId { get; set; }
		public int? UserId { get; set; }
		public string What { get; set; }
		public DateTime Date { get; set; }
		public string Referrer { get; set; }
		public string How { get; set; }
		public string ContentItemId { get; set; }

		public static TrackPage Create(Guid trackVisitId, int? userId, string what, string how = null, string referrer = null, string contentItemId = null)
		{
			return new TrackPage()
			{
				TrackPageId = Guid.NewGuid(),
				TrackVisitId = trackVisitId,
				UserId = userId,
				What = what,
				Date = DateTime.UtcNow,
				How = how,
				Referrer = referrer,
				ContentItemId = contentItemId
			};
		}
	}
}
